import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import installElementPlus from './plugins/element'
import ECharts from 'vue-echarts'
import { use } from "echarts/core"
import * as echarts from "echarts";



// import ECharts modules manually to reduce bundle size
import {
  CanvasRenderer
} from 'echarts/renderers'
import {
  BarChart
} from 'echarts/charts'
import {
  GridComponent,
  TooltipComponent
} from 'echarts/components'

use([
  CanvasRenderer,
  BarChart,
  GridComponent,
  TooltipComponent
])

axios.defaults.baseURL = '/api'
// axios.interceptors.request.use(config => {
//     config.headers.HTTP_X_FORWARDED_FOR = localStorage.getItem('Ip').split('.').join(' ')
//     return config
// })

let app = createApp(App)
app.component('v-chart', ECharts)
installElementPlus(app)
app.config.globalProperties.$echarts = echarts;
app.use(store).use(router, axios).mount('#app')
